// @ts-ignore
import { api } from '@/utils/api';

/** 新增角色数据权限配置信息数据 POST /roleDataPermission/add */
export async function roleDataPermissionAdd(
  body: BASE.RoleDataPermission,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function roleDataPermissionAdd(
  body: BASE.RoleDataPermission,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function roleDataPermissionAdd(
  body: BASE.RoleDataPermission,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function roleDataPermissionAdd(
  body: BASE.RoleDataPermission,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/roleDataPermission/add`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/roleDataPermission/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 删除角色数据权限配置信息数据 POST /roleDataPermission/delete */
export async function roleDataPermissionDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function roleDataPermissionDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function roleDataPermissionDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function roleDataPermissionDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/roleDataPermission/delete`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/roleDataPermission/delete`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 获取角色数据权限配置信息数据 POST /roleDataPermission/get */
export async function roleDataPermissionGet(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultRoleDataPermission>;

export async function roleDataPermissionGet(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultRoleDataPermission>>;

export async function roleDataPermissionGet(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultRoleDataPermission>;

export async function roleDataPermissionGet(body: BASE.ID, options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultRoleDataPermission>(`/app/roleDataPermission/get`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultRoleDataPermission>(`/app/roleDataPermission/get`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 获取表的列名 GET /roleDataPermission/getColumnName */
export async function roleDataPermissionGetColumnName(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BASE.roleDataPermissionGetColumnNameParams,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultListString>;

export async function roleDataPermissionGetColumnName(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BASE.roleDataPermissionGetColumnNameParams,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultListString>>;

export async function roleDataPermissionGetColumnName(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BASE.roleDataPermissionGetColumnNameParams,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultListString>;

export async function roleDataPermissionGetColumnName(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: BASE.roleDataPermissionGetColumnNameParams,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultListString>(`/app/roleDataPermission/getColumnName`, {
      method: 'GET',
      params: {
        ...params
      },
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultListString>(`/app/roleDataPermission/getColumnName`, {
    method: 'GET',
    params: {
      ...params
    },
    ...(options || {})
  });
}

/** 获取数据权限操作类型枚举 POST /roleDataPermission/getOperateType */
export async function roleDataPermissionGetOperateType(
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultListDataPermissionOperateVO>;

export async function roleDataPermissionGetOperateType(
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultListDataPermissionOperateVO>>;

export async function roleDataPermissionGetOperateType(
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultListDataPermissionOperateVO>;

export async function roleDataPermissionGetOperateType(options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultListDataPermissionOperateVO>(`/app/roleDataPermission/getOperateType`, {
      method: 'POST',
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultListDataPermissionOperateVO>(`/app/roleDataPermission/getOperateType`, {
    method: 'POST',
    ...(options || {})
  });
}

/** 获取数据权限操作类型枚举 POST /roleDataPermission/getRelationType */
export async function roleDataPermissionGetRelationType(
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultListDataPermissionOperateVO>;

export async function roleDataPermissionGetRelationType(
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultListDataPermissionOperateVO>>;

export async function roleDataPermissionGetRelationType(
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultListDataPermissionOperateVO>;

export async function roleDataPermissionGetRelationType(options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultListDataPermissionOperateVO>(`/app/roleDataPermission/getRelationType`, {
      method: 'POST',
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultListDataPermissionOperateVO>(`/app/roleDataPermission/getRelationType`, {
    method: 'POST',
    ...(options || {})
  });
}

/** 获取角色数据权限配置信息分页数据 POST /roleDataPermission/page */
export async function roleDataPermissionPage(
  body: BASE.RoleDataPermissionQuery,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultIPageRoleDataPermission>;

export async function roleDataPermissionPage(
  body: BASE.RoleDataPermissionQuery,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultIPageRoleDataPermission>>;

export async function roleDataPermissionPage(
  body: BASE.RoleDataPermissionQuery,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultIPageRoleDataPermission>;

export async function roleDataPermissionPage(
  body: BASE.RoleDataPermissionQuery,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultIPageRoleDataPermission>(`/app/roleDataPermission/page`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultIPageRoleDataPermission>(`/app/roleDataPermission/page`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 更新角色数据权限配置信息数据 POST /roleDataPermission/update */
export async function roleDataPermissionUpdate(
  body: BASE.RoleDataPermission,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function roleDataPermissionUpdate(
  body: BASE.RoleDataPermission,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function roleDataPermissionUpdate(
  body: BASE.RoleDataPermission,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function roleDataPermissionUpdate(
  body: BASE.RoleDataPermission,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/roleDataPermission/update`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/roleDataPermission/update`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}
